#include "../core/smart_ptr.hpp"

#include "../lge2d.hpp"

struct T
{
	unsigned _i;
	T(unsigned i) : _i(i) {lge2d::log->Info("T(%d)", _i);}
	~T() {lge2d::log->Info("~T(%d)", _i);}
};

typedef lge2d::SmartPtr<T> TPtr;

void f(TPtr t)
{
	TPtr x = t;
}

void SmartPtrTest()
{
	TPtr p2 (new T(2));
	{
		TPtr p3(p2);

		TPtr p(new T(1));
		p2 = p;

		f(p2);

		p2.Reset();
	}
}
